/*
* QuickRank - A C++ suite of Learning to Rank algorithms
* Webpage: http://quickrank.isti.cnr.it/
* Contact: quickrank@isti.cnr.it
    *
    * Unless explicitly acquired and licensed from Licensor under another
    * license, the contents of this file are subject to the Reciprocal Public
    * License ("RPL") Version 1.5, or subsequent versions as allowed by the RPL,
* and You may not copy or use this file in either source code or executable
    * form, except in compliance with the terms and conditions of the RPL.
*
* All software distributed under the RPL is provided strictly on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND
* LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
    * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the RPL for specific
    * language governing rights and limitations under the RPL.
*
* Contributor:
*   HPC. Laboratory - ISTI - CNR - http://hpc.isti.cnr.it/
*/
#pragma once

#include <string>
#include <iostream>
#include <sys/stat.h>

inline bool file_exist(const std::string &filename) {
  struct stat buffer;
  return (stat(filename.c_str(), &buffer) == 0);
}
